package com.kouxin.appaccount.misc;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.StrutsStatics;
import org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;

public class MyAnnotationValidationInterceptor extends AnnotationValidationInterceptor {

	private static final long serialVersionUID = 4323541570191572935L;

	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		ActionContext actionContext = invocation.getInvocationContext();
		HttpServletRequest request= (HttpServletRequest) actionContext.get(StrutsStatics.HTTP_REQUEST);
		if ("GET".equals(request.getMethod().trim().toUpperCase())) {
			return Action.INPUT;
		}
		return super.doIntercept(invocation);
	}

}
